package com.imooc.ad.index.adunit;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdUnitObject {

    private Long unitId;
    private Integer unitStatus;
    private Integer positionType;
    private Long planId;

    private AdUnitObject adUnitObject;

    void update(AdUnitObject newObject){
        if (null != newObject.getUnitId()){
            this.unitId = newObject.unitId;
        }
        if (null != unitStatus){
            this.unitStatus = newObject.getUnitStatus();
        }
        if (null != newObject.getAdUnitObject()){
            this.positionType = newObject.getPositionType();
        }
        if (null != newObject.getPlanId()){
            this.planId = newObject.getPlanId();
        }

        if (null != newObject.getAdUnitObject()){
            this.adUnitObject = newObject.getAdUnitObject();
        }
    }
}
